package com.dou.baidumaptest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.baidu.mapapi.map.MapView;

public class MainActivity extends Activity {

    MapView mMapView = null;
    private LinearLayout linearLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //在使用SDK各组件之前初始化context信息，传入ApplicationContext
        //注意该方法要再setContentView方法之前实现
       // SDKInitializer.initialize(getApplicationContext());
        setContentView(R.layout.activity_main);
        linearLayout = (LinearLayout) findViewById(R.id.map);
        //获取地图控件引用
        mMapView = (MapView) findViewById(R.id.bmapView);
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        //在activity执行onDestroy时执行mMapView.onDestroy()，实现地图生命周期管理
        mMapView.onDestroy();
    }
    @Override
    protected void onResume() {
        super.onResume();
        //在activity执行onResume时执行mMapView. onResume ()，实现地图生命周期管理
        mMapView.onResume();
    }
    @Override
    protected void onPause() {
        super.onPause();
        //在activity执行onPause时执行mMapView. onPause ()，实现地图生命周期管理
        mMapView.onPause();
    }

    public void location(View view) {
        startActivity(new Intent(this,LocationDemo.class));
    }

    public void trajectory(View view) {
        startActivity(new Intent(this,TrackShowDemo.class));
    }
}
